Load all required libraries.
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5 v purrr 0.3.4
## v tibble 3.1.6 v dplyr 1.0.8
## v tidyr 1.2.0 v stringr 1.4.0
## v readr 2.1.2 v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(broom)
Read in raw data from RDS.
raw_data <- readRDS("./n1_n2_cleaned_cases.rds")
Make a few small modifications to names and data for visualizations.
final_data <- raw_data %>% mutate(log_copy_per_L = log10(mean_copy_num_L)) %>%
rename(Facility = wrf) %>%
mutate(Facility = recode(Facility,
"NO" = "WRF A",
"MI" = "WRF B",
"CC" = "WRF C"))
Seperate the data by gene target to ease layering in the final plot
#make three data layers
only_positives <<- subset(final_data, (!is.na(final_data$Facility)))
only_n1 <- subset(only_positives, target == "N1")
only_n2 <- subset(only_positives, target == "N2")
only_background <<-final_data %>%
select(c(date, cases_cum_clarke, new_cases_clarke, X7_day_ave_clarke)) %>%
group_by(date) %>% summarise_if(is.numeric, mean)
#specify fun colors
background_color <- "#7570B3"
seven_day_ave_color <- "#E6AB02"
marker_colors <- c("N1" = '#1B9E77',"N2" ='#D95F02')
#remove facilty C for now
#only_n1 <- only_n1[!(only_n1$Facility == "WRF C"),]
#only_n2 <- only_n2[!(only_n2$Facility == "WRF C"),]
only_n1 <- only_n1[!(only_n1$Facility == "WRF A" & only_n1$date == "2020-11-02"), ]
only_n2 <- only_n2[!(only_n2$Facility == "WRF A" & only_n2$date == "2020-11-02"), ]
Build the main plot
#first layer is the background epidemic curve
p1 <- only_background %>%
plotly::plot_ly() %>%
plotly::add_trace(x = ~date, y = ~new_cases_clarke,
type = "bar",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Daily Cases: ', new_cases_clarke),
alpha = 0.5,
name = "Daily Reported Cases",
color = background_color,
colors = background_color,
showlegend = FALSE) %>%
layout(yaxis = list(title = "Clarke County Daily Cases", showline=TRUE)) %>%
layout(legend = list(orientation = "h", x = 0.2, y = -0.3))
#renders the main plot layer two as seven day moving average
p1 <- p1 %>% plotly::add_trace(x = ~date, y = ~X7_day_ave_clarke,
type = "scatter",
mode = "lines",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Seven-Day Moving Average: ', X7_day_ave_clarke),
name = "Seven Day Moving Average Athens",
line = list(color = seven_day_ave_color),
showlegend = FALSE)
#renders the main plot layer three as positive target hits
p2 <- plotly::plot_ly() %>%
plotly::add_trace(x = ~date, y = ~mean_copy_num_L,
type = "scatter",
mode = "markers",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Facility: ', Facility,
'</br> Target: ', target,
'</br> Copies/L: ', round(mean_copy_num_L, digits = 2)),
data = only_n1,
symbol = ~Facility,
marker = list(color = '#1B9E77', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
plotly::add_trace(x = ~date, y = ~mean_copy_num_L,
type = "scatter",
mode = "markers",
hoverinfo = "text",
text = ~paste('</br> Date: ', date,
'</br> Facility: ', Facility,
'</br> Target: ', target,
'</br> Copies/L: ', round(mean_copy_num_L, digits = 2)),
data = only_n2,
symbol = ~Facility,
marker = list(color = '#D95F02', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(yaxis = list(title = "SARS CoV-2 Copies/L",
showline = TRUE,
type = "log",
dtick = 1,
automargin = TRUE)) %>%
layout(legend = list(orientation = "h", x = 0.2, y = -0.3))
#adds the limit of detection dashed line
p2 <- p2 %>% plotly::add_segments(x = as.Date("2020-03-14"),
xend = ~max(date + 10),
y = 3571.429, yend = 3571.429,
opacity = 0.35,
line = list(color = "black", dash = "dash")) %>%
layout(annotations = list(x = as.Date("2020-03-28"), y = 3.8, xref = "x", yref = "y",
text = "Limit of Detection", showarrow = FALSE))
p1
p2
Combine the two main plot pieces as a subplot
#seperate n1 and n2 frames by site
#n1
wrf_a_only_n1 <- subset(only_n1, Facility == "WRF A")
wrf_b_only_n1 <- subset(only_n1, Facility == "WRF B")
wrf_c_only_n1 <- subset(only_n1, Facility == "WRF C")
#n2
wrf_a_only_n2 <- subset(only_n2, Facility == "WRF A")
wrf_b_only_n2 <- subset(only_n2, Facility == "WRF B")
wrf_c_only_n2 <- subset(only_n2, Facility == "WRF C")
#rejoin the old data frames then seperate in to averages for each plant.
wrfa_both <- full_join(wrf_a_only_n1, wrf_a_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
wrfb_both <- full_join(wrf_b_only_n1, wrf_b_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
wrfc_both <- full_join(wrf_c_only_n1, wrf_c_only_n2)%>%
select(c(date, mean_total_copies)) %>%
group_by(date) %>%
summarize_if(is.numeric, mean) %>%
ungroup() %>%
mutate(log_total_copies_both = log10(mean_total_copies))
## Joining, by = c("date", "new_cases_clarke", "cases_cum_clarke",
## "X7_day_ave_clarke", "Facility", "collection_num", "target",
## "mean_copy_num_uL_rxn", "mean_copy_num_L", "sd_L", "se_L", "mean_total_copies",
## "sd_total_copies", "lo_95", "up_95", "log_copy_per_L")
#get max date
maxdate <- max(wrfa_both$date)
mindate <- min(wrfa_both$date)
Build loess smoothing figures figures
This makes the individual plots
#**************************************WRF A PLOT**********************************************
#add trendlines
#extract data from geom_smooth
#both extract
# *********************************span 0.6***********************************
#*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_botha <- ggplot(wrfa_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_botha<<-..y..), method = "loess", color = '#1B9E77',
span = 0.25, n = 786)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_botha
## `geom_smooth()` using formula 'y ~ x'
fit_botha
## [1] 13.05249 13.04773 13.04304 13.03839 13.03380 13.02927 13.02478 13.02035
## [9] 13.01597 13.01164 13.00735 13.00312 12.99893 12.99478 12.99068 12.98663
## [17] 12.98262 12.97865 12.97472 12.97083 12.96698 12.96317 12.95940 12.95567
## [25] 12.95197 12.94830 12.94467 12.94108 12.93751 12.93398 12.93048 12.92700
## [33] 12.92356 12.92014 12.91675 12.91339 12.91005 12.90674 12.90345 12.90018
## [41] 12.89693 12.89370 12.89050 12.88731 12.88413 12.88098 12.87785 12.87473
## [49] 12.87165 12.86859 12.86557 12.86257 12.85961 12.85669 12.85381 12.85098
## [57] 12.84818 12.84544 12.84274 12.84010 12.83751 12.83497 12.83250 12.83009
## [65] 12.82774 12.82546 12.82325 12.82110 12.81904 12.81704 12.81513 12.81330
## [73] 12.81155 12.80988 12.80830 12.80682 12.80542 12.80412 12.80292 12.80182
## [81] 12.80082 12.79993 12.79914 12.79846 12.79789 12.79733 12.79667 12.79592
## [89] 12.79509 12.79418 12.79320 12.79217 12.79109 12.78997 12.78881 12.78763
## [97] 12.78643 12.78522 12.78401 12.78280 12.78161 12.78045 12.77931 12.77821
## [105] 12.77716 12.77617 12.77524 12.77438 12.77360 12.77291 12.77232 12.77183
## [113] 12.77145 12.77119 12.77106 12.77107 12.77122 12.77152 12.77199 12.77262
## [121] 12.77343 12.77443 12.77562 12.77701 12.77861 12.78042 12.78247 12.78474
## [129] 12.78792 12.79255 12.79850 12.80562 12.81377 12.82280 12.83258 12.84297
## [137] 12.85380 12.86496 12.87628 12.88764 12.89888 12.90986 12.92044 12.93048
## [145] 12.93983 12.94835 12.95590 12.96234 12.96752 12.97303 12.98045 12.98963
## [153] 13.00039 13.01257 13.02600 13.04052 13.05597 13.07217 13.08898 13.10621
## [161] 13.12370 13.14129 13.15882 13.17612 13.19302 13.20936 13.22498 13.23970
## [169] 13.25337 13.26582 13.27688 13.28640 13.29419 13.30011 13.30398 13.30689
## [177] 13.31003 13.31334 13.31678 13.32030 13.32386 13.32742 13.33093 13.33434
## [185] 13.33761 13.34069 13.34354 13.34612 13.34838 13.35027 13.35175 13.35278
## [193] 13.35330 13.35328 13.35267 13.35142 13.34950 13.34684 13.34342 13.33918
## [201] 13.33408 13.32808 13.32113 13.31318 13.30419 13.29324 13.27960 13.26351
## [209] 13.24522 13.22497 13.20300 13.17956 13.15490 13.12925 13.10286 13.07597
## [217] 13.04883 13.02167 12.99476 12.96832 12.94260 12.91785 12.89430 12.87221
## [225] 12.85181 12.83336 12.81443 12.79264 12.76830 12.74170 12.71314 12.68293
## [233] 12.65136 12.61874 12.58535 12.55151 12.51751 12.48366 12.45024 12.41757
## [241] 12.38594 12.35565 12.32700 12.30029 12.27582 12.25389 12.23480 12.21766
## [249] 12.20136 12.18583 12.17105 12.15696 12.14352 12.13067 12.11839 12.10661
## [257] 12.09529 12.08439 12.07386 12.06365 12.05373 12.04403 12.03452 12.02516
## [265] 12.01588 12.00666 11.99743 11.98816 11.97881 11.96931 11.95963 11.94973
## [273] 11.93955 11.93007 11.92220 11.91577 11.91063 11.90661 11.90357 11.90133
## [281] 11.89975 11.89865 11.89790 11.89731 11.89675 11.89604 11.89503 11.89356
## [289] 11.89147 11.88860 11.88480 11.87990 11.87375 11.86618 11.85765 11.84873
## [297] 11.83947 11.82990 11.82009 11.81007 11.79988 11.78958 11.77921 11.76881
## [305] 11.75843 11.74811 11.73791 11.72785 11.71800 11.70839 11.69908 11.69009
## [313] 11.68149 11.67332 11.66562 11.65692 11.64590 11.63281 11.61793 11.60150
## [321] 11.58379 11.56505 11.54555 11.52555 11.50531 11.48507 11.46512 11.44570
## [329] 11.42707 11.40950 11.39325 11.37856 11.36572 11.35496 11.34656 11.34077
## [337] 11.33785 11.33635 11.33469 11.33295 11.33121 11.32953 11.32799 11.32668
## [345] 11.32565 11.32500 11.32479 11.32509 11.32599 11.32756 11.32987 11.33301
## [353] 11.33703 11.34203 11.34807 11.35523 11.36359 11.37321 11.38418 11.39752
## [361] 11.41404 11.43351 11.45568 11.48033 11.50721 11.53609 11.56673 11.59890
## [369] 11.63235 11.66686 11.70219 11.73809 11.77433 11.81069 11.84691 11.88276
## [377] 11.91801 11.95242 11.98575 12.01776 12.04823 12.07691 12.10357 12.12796
## [385] 12.14986 12.17202 12.19711 12.22480 12.25473 12.28658 12.31999 12.35462
## [393] 12.39012 12.42616 12.46239 12.49847 12.53405 12.56879 12.60234 12.63437
## [401] 12.66453 12.69247 12.71786 12.74035 12.75959 12.77524 12.78869 12.80154
## [409] 12.81380 12.82546 12.83653 12.84702 12.85692 12.86624 12.87498 12.88314
## [417] 12.89073 12.89775 12.90419 12.91007 12.91538 12.92013 12.92432 12.92796
## [425] 12.93104 12.93356 12.93554 12.93580 12.93333 12.92834 12.92106 12.91172
## [433] 12.90054 12.88773 12.87352 12.85814 12.84181 12.82475 12.80718 12.78932
## [441] 12.77140 12.75365 12.73628 12.71951 12.70358 12.68869 12.67508 12.66297
## [449] 12.65258 12.64413 12.63560 12.62496 12.61243 12.59824 12.58261 12.56577
## [457] 12.54793 12.52932 12.51016 12.49068 12.47110 12.45165 12.43254 12.41400
## [465] 12.39625 12.37952 12.36403 12.35000 12.33766 12.32723 12.31893 12.31125
## [473] 12.30259 12.29310 12.28291 12.27217 12.26100 12.24955 12.23796 12.22636
## [481] 12.21488 12.20368 12.19288 12.18262 12.17304 12.16427 12.15647 12.14975
## [489] 12.14426 12.14014 12.13752 12.13655 12.13743 12.14018 12.14467 12.15076
## [497] 12.15832 12.16720 12.17729 12.18843 12.20049 12.21334 12.22684 12.24086
## [505] 12.25525 12.26988 12.28462 12.29933 12.31387 12.32810 12.34190 12.35513
## [513] 12.36764 12.37931 12.38999 12.39955 12.40786 12.41478 12.42197 12.43108
## [521] 12.44195 12.45441 12.46828 12.48339 12.49959 12.51669 12.53453 12.55294
## [529] 12.57176 12.59080 12.60991 12.62891 12.64764 12.66592 12.68359 12.70048
## [537] 12.71642 12.73123 12.74476 12.75683 12.76727 12.77591 12.78259 12.78713
## [545] 12.78937 12.78913 12.78713 12.78423 12.78047 12.77590 12.77056 12.76451
## [553] 12.75780 12.75046 12.74254 12.73411 12.72519 12.71584 12.70611 12.69605
## [561] 12.68569 12.67510 12.66431 12.65337 12.64234 12.63126 12.62017 12.60913
## [569] 12.59818 12.58554 12.56963 12.55078 12.52931 12.50556 12.47986 12.45254
## [577] 12.42393 12.39436 12.36416 12.33366 12.30320 12.27309 12.24369 12.21530
## [585] 12.18827 12.16293 12.13961 12.11863 12.10033 12.08504 12.06979 12.05164
## [593] 12.03093 12.00801 11.98322 11.95692 11.92944 11.90114 11.87236 11.84344
## [601] 11.81474 11.78661 11.75937 11.73340 11.70902 11.68659 11.66645 11.64895
## [609] 11.63444 11.62326 11.61438 11.60649 11.59957 11.59358 11.58850 11.58427
## [617] 11.58089 11.57830 11.57649 11.57540 11.57503 11.57532 11.57625 11.57778
## [625] 11.57988 11.58253 11.58567 11.58929 11.59335 11.59782 11.60266 11.60784
## [633] 11.61333 11.61910 11.62511 11.63133 11.63772 11.64554 11.65589 11.66855
## [641] 11.68327 11.69983 11.71798 11.73751 11.75817 11.77973 11.80195 11.82461
## [649] 11.84747 11.87029 11.89285 11.91490 11.93622 11.95657 11.97572 11.99344
## [657] 12.00948 12.02362 12.03732 12.05213 12.06793 12.08462 12.10209 12.12023
## [665] 12.13892 12.15806 12.17754 12.19726 12.21709 12.23693 12.25667 12.27621
## [673] 12.29542 12.31421 12.33246 12.35007 12.36692 12.38290 12.39791 12.41183
## [681] 12.42456 12.43667 12.44879 12.46091 12.47299 12.48501 12.49696 12.50881
## [689] 12.52054 12.53212 12.54353 12.55476 12.56577 12.57654 12.58706 12.59729
## [697] 12.60723 12.61684 12.62609 12.63498 12.64348 12.65155 12.65915 12.66625
## [705] 12.67289 12.67909 12.68489 12.69034 12.69546 12.70028 12.70485 12.70919
## [713] 12.71335 12.71735 12.72124 12.72504 12.72879 12.73252 12.73628 12.74009
## [721] 12.74399 12.74801 12.75220 12.75633 12.76021 12.76383 12.76722 12.77039
## [729] 12.77336 12.77614 12.77874 12.78118 12.78348 12.78565 12.78770 12.78965
## [737] 12.79151 12.79330 12.79504 12.79673 12.79840 12.80006 12.80172 12.80339
## [745] 12.80502 12.80652 12.80790 12.80916 12.81030 12.81132 12.81222 12.81300
## [753] 12.81366 12.81422 12.81465 12.81498 12.81519 12.81529 12.81528 12.81516
## [761] 12.81494 12.81461 12.81417 12.81363 12.81299 12.81226 12.81147 12.81060
## [769] 12.80967 12.80866 12.80757 12.80640 12.80514 12.80380 12.80237 12.80084
## [777] 12.79922 12.79750 12.79567 12.79374 12.79170 12.78955 12.78728 12.78490
## [785] 12.78239 12.77976
#assign fits to a vector
both_trenda <- fit_botha
#extract y min and max for each
limits_botha <- ggplot_build(extract_botha)$data
## `geom_smooth()` using formula 'y ~ x'
limits_botha <- as.data.frame(limits_botha)
both_ymina <- limits_botha$ymin
both_ymaxa <- limits_botha$ymax
#reassign dataframes (just to be safe)
work_botha <- wrfa_both
#fill in missing dates to smooth fits
work_botha <- work_botha %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_botha <- work_botha$date
#create a new smooth dataframe to layer
smooth_frame_botha <- data.frame(date_vec_botha, both_trenda, both_ymina, both_ymaxa)
#WRF A
#plot smooth frames
p_wrf_a <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_botha, y = ~both_trenda,
data = smooth_frame_botha,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_botha,
'</br> Median Log Copies: ', round(both_trenda, digits = 2)),
line = list(color = '#1B9E77', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_botha, ymin = ~both_ymina, ymax = ~both_ymaxa,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_botha, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxa, digits = 2),
'</br> Min Log Copies: ', round(both_ymina, digits = 2)),
name = "",
fillcolor = '#1B9E77',
line = list(color = '#1B9E77')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF A") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfa_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#1B9E77', size = 6, opacity = 0.65))
p_wrf_a
save(p_wrf_a, file = "./plotly_objs/p_wrf_a.rda")
#**************************************WRF B PLOT**********************************************
#add trendlines
#extract data from geom_smooth
#both extract
# *********************************span 0.6***********************************
#*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_bothb <- ggplot(wrfb_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_bothb<<-..y..), method = "loess", color = '#D95F02',
span = 0.25, n = 786)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_bothb
## `geom_smooth()` using formula 'y ~ x'
fit_bothb
## [1] 12.62462 12.61998 12.61542 12.61095 12.60657 12.60228 12.59807 12.59395
## [9] 12.58992 12.58597 12.58211 12.57834 12.57464 12.57104 12.56751 12.56407
## [17] 12.56072 12.55744 12.55425 12.55114 12.54812 12.54517 12.54231 12.53952
## [25] 12.53682 12.53420 12.53165 12.52919 12.52680 12.52450 12.52227 12.52012
## [33] 12.51804 12.51605 12.51413 12.51228 12.51052 12.50883 12.50721 12.50567
## [41] 12.50420 12.50281 12.50149 12.50025 12.49908 12.49800 12.49700 12.49608
## [49] 12.49524 12.49449 12.49382 12.49323 12.49273 12.49231 12.49199 12.49174
## [57] 12.49159 12.49152 12.49154 12.49166 12.49186 12.49215 12.49254 12.49301
## [65] 12.49358 12.49425 12.49501 12.49586 12.49681 12.49785 12.49899 12.50023
## [73] 12.50157 12.50300 12.50454 12.50617 12.50791 12.50974 12.51168 12.51372
## [81] 12.51587 12.51812 12.52047 12.52293 12.52549 12.52822 12.53116 12.53430
## [89] 12.53764 12.54117 12.54488 12.54876 12.55282 12.55703 12.56140 12.56591
## [97] 12.57056 12.57535 12.58026 12.58528 12.59042 12.59566 12.60099 12.60641
## [105] 12.61191 12.61749 12.62313 12.62884 12.63459 12.64039 12.64623 12.65209
## [113] 12.65798 12.66389 12.66980 12.67572 12.68163 12.68752 12.69340 12.69925
## [121] 12.70506 12.71083 12.71655 12.72222 12.72782 12.73335 12.73924 12.74586
## [129] 12.75314 12.76100 12.76936 12.77813 12.78725 12.79663 12.80619 12.81585
## [137] 12.82553 12.83515 12.84464 12.85392 12.86290 12.87150 12.87965 12.88727
## [145] 12.89428 12.90059 12.90613 12.91258 12.92149 12.93264 12.94578 12.96068
## [153] 12.97710 12.99480 13.01354 13.03309 13.05321 13.07365 13.09419 13.11458
## [161] 13.13459 13.15397 13.17250 13.18992 13.20601 13.22053 13.23324 13.24390
## [169] 13.25227 13.25811 13.26250 13.26665 13.27056 13.27420 13.27756 13.28064
## [177] 13.28341 13.28587 13.28801 13.28980 13.29125 13.29233 13.29303 13.29334
## [185] 13.29324 13.29273 13.29180 13.29041 13.28858 13.28628 13.28349 13.28022
## [193] 13.27644 13.27213 13.26730 13.26193 13.25599 13.24949 13.24240 13.23472
## [201] 13.22643 13.21752 13.20797 13.19778 13.18538 13.16948 13.15043 13.12858
## [209] 13.10429 13.07793 13.04985 13.02040 12.98996 12.95886 12.92747 12.89616
## [217] 12.86527 12.83516 12.80620 12.77873 12.75312 12.72973 12.70891 12.69103
## [225] 12.67365 12.65427 12.63312 12.61041 12.58637 12.56121 12.53518 12.50848
## [233] 12.48133 12.45397 12.42662 12.39949 12.37281 12.34680 12.32169 12.29770
## [241] 12.27505 12.25396 12.23466 12.21737 12.20231 12.18908 12.17709 12.16624
## [249] 12.15644 12.14760 12.13962 12.13241 12.12588 12.11994 12.11449 12.10944
## [257] 12.10470 12.10018 12.09578 12.09141 12.08699 12.08241 12.07758 12.07242
## [265] 12.06683 12.06072 12.05399 12.04655 12.03992 12.03551 12.03310 12.03247
## [273] 12.03338 12.03562 12.03896 12.04318 12.04805 12.05334 12.05883 12.06429
## [281] 12.06951 12.07425 12.07830 12.08141 12.08338 12.08397 12.08297 12.08014
## [289] 12.07526 12.06933 12.06348 12.05770 12.05196 12.04627 12.04058 12.03490
## [297] 12.02920 12.02347 12.01768 12.01183 12.00589 11.99985 11.99369 11.98740
## [305] 11.98095 11.97434 11.96754 11.96053 11.95331 11.94585 11.93677 11.92491
## [313] 11.91056 11.89403 11.87563 11.85567 11.83446 11.81229 11.78948 11.76633
## [321] 11.74315 11.72025 11.69793 11.67650 11.65626 11.63753 11.62060 11.60579
## [329] 11.59340 11.58374 11.57711 11.57164 11.56535 11.55833 11.55071 11.54259
## [337] 11.53407 11.52528 11.51633 11.50731 11.49836 11.48956 11.48105 11.47292
## [345] 11.46529 11.45827 11.45197 11.44650 11.44197 11.43850 11.43619 11.43515
## [353] 11.43549 11.43734 11.44079 11.44595 11.45295 11.46244 11.47487 11.49000
## [361] 11.50757 11.52736 11.54912 11.57261 11.59758 11.62381 11.65104 11.67903
## [369] 11.70755 11.73635 11.76520 11.79384 11.82205 11.84957 11.87618 11.90161
## [377] 11.92565 11.94803 11.96854 11.98691 12.00584 12.02794 12.05288 12.08030
## [385] 12.10987 12.14125 12.17409 12.20804 12.24278 12.27795 12.31322 12.34823
## [393] 12.38266 12.41615 12.44836 12.47896 12.50760 12.53393 12.55762 12.57832
## [401] 12.59569 12.61190 12.62924 12.64753 12.66660 12.68629 12.70642 12.72683
## [409] 12.74734 12.76779 12.78801 12.80782 12.82705 12.84555 12.86313 12.87962
## [417] 12.89486 12.90868 12.92090 12.93136 12.93989 12.94632 12.95063 12.95302
## [425] 12.95361 12.95250 12.94982 12.94569 12.94023 12.93356 12.92579 12.91704
## [433] 12.90743 12.89709 12.88612 12.87465 12.86280 12.85068 12.83842 12.82613
## [441] 12.81393 12.80193 12.79027 12.77905 12.76840 12.75843 12.74927 12.74102
## [449] 12.73158 12.71897 12.70352 12.68556 12.66543 12.64346 12.61999 12.59534
## [457] 12.56986 12.54387 12.51770 12.49170 12.46619 12.44150 12.41798 12.39595
## [465] 12.37574 12.35770 12.34215 12.32942 12.31985 12.31121 12.30114 12.28984
## [473] 12.27749 12.26429 12.25042 12.23607 12.22144 12.20670 12.19205 12.17767
## [481] 12.16375 12.15049 12.13807 12.12667 12.11650 12.10772 12.10055 12.09515
## [489] 12.09172 12.09045 12.09099 12.09278 12.09574 12.09977 12.10479 12.11070
## [497] 12.11741 12.12483 12.13287 12.14143 12.15043 12.15977 12.16936 12.17911
## [505] 12.18893 12.19873 12.20841 12.21789 12.22707 12.23586 12.24417 12.25396
## [513] 12.26707 12.28325 12.30224 12.32377 12.34759 12.37343 12.40104 12.43016
## [521] 12.46053 12.49189 12.52397 12.55652 12.58929 12.62200 12.65440 12.68623
## [529] 12.71724 12.74715 12.77572 12.80267 12.82776 12.85072 12.87129 12.88922
## [537] 12.90424 12.91609 12.92452 12.93121 12.93800 12.94483 12.95165 12.95841
## [545] 12.96505 12.97153 12.97779 12.98378 12.98944 12.99473 12.99959 13.00397
## [553] 13.00782 13.01108 13.01370 13.01563 13.01682 13.01722 13.01676 13.01541
## [561] 13.01311 13.00980 13.00543 12.99995 12.99332 12.98546 12.97635 12.96455
## [569] 12.94893 12.92986 12.90771 12.88285 12.85565 12.82647 12.79568 12.76365
## [577] 12.73075 12.69735 12.66381 12.63051 12.59781 12.56608 12.53569 12.50701
## [585] 12.48040 12.45624 12.43489 12.41672 12.39829 12.37616 12.35074 12.32244
## [593] 12.29164 12.25876 12.22418 12.18832 12.15157 12.11433 12.07700 12.03998
## [601] 12.00367 11.96847 11.93479 11.90302 11.87356 11.84682 11.82318 11.80306
## [609] 11.78686 11.77259 11.75809 11.74343 11.72869 11.71395 11.69929 11.68479
## [617] 11.67054 11.65661 11.64308 11.63004 11.61756 11.60572 11.59461 11.58430
## [625] 11.57488 11.56642 11.55901 11.55273 11.54765 11.54386 11.54143 11.54046
## [633] 11.54162 11.54541 11.55161 11.56001 11.57039 11.58253 11.59621 11.61121
## [641] 11.62732 11.64433 11.66200 11.68013 11.69850 11.71689 11.73508 11.75286
## [649] 11.77000 11.78629 11.80152 11.81546 11.82790 11.84064 11.85553 11.87238
## [657] 11.89105 11.91135 11.93313 11.95622 11.98045 12.00565 12.03167 12.05833
## [665] 12.08546 12.11291 12.14051 12.16808 12.19546 12.22249 12.24900 12.27482
## [673] 12.29979 12.32374 12.34651 12.36792 12.38782 12.40603 12.42239 12.43799
## [681] 12.45398 12.47032 12.48693 12.50378 12.52080 12.53794 12.55514 12.57234
## [689] 12.58949 12.60654 12.62342 12.64008 12.65647 12.67253 12.68819 12.70342
## [697] 12.71815 12.73232 12.74588 12.75878 12.77095 12.78248 12.79353 12.80412
## [705] 12.81428 12.82405 12.83345 12.84253 12.85131 12.85982 12.86809 12.87616
## [713] 12.88407 12.89183 12.89948 12.90707 12.91460 12.92213 12.92968 12.93728
## [721] 12.94496 12.95276 12.96071 12.96861 12.97626 12.98367 12.99085 12.99781
## [729] 13.00456 13.01111 13.01747 13.02366 13.02968 13.03554 13.04126 13.04685
## [737] 13.05232 13.05767 13.06292 13.06809 13.07317 13.07818 13.08314 13.08805
## [745] 13.09286 13.09751 13.10200 13.10633 13.11050 13.11453 13.11840 13.12213
## [753] 13.12571 13.12915 13.13245 13.13561 13.13863 13.14152 13.14428 13.14692
## [761] 13.14942 13.15180 13.15406 13.15620 13.15823 13.16015 13.16198 13.16371
## [769] 13.16535 13.16688 13.16831 13.16964 13.17085 13.17195 13.17293 13.17379
## [777] 13.17453 13.17514 13.17562 13.17597 13.17618 13.17625 13.17618 13.17596
## [785] 13.17560 13.17508
#assign fits to a vector
both_trendb <- fit_bothb
#extract y min and max for each
limits_bothb <- ggplot_build(extract_bothb)$data
## `geom_smooth()` using formula 'y ~ x'
limits_bothb <- as.data.frame(limits_bothb)
both_yminb <- limits_bothb$ymin
both_ymaxb <- limits_bothb$ymax
#reassign dataframes (just to be safe)
work_bothb <- wrfb_both
#fill in missing dates to smooth fits
work_bothb <- work_bothb %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_bothb <- work_bothb$date
#create a new smooth dataframe to layer
smooth_frame_bothb <- data.frame(date_vec_bothb, both_trendb, both_yminb, both_ymaxb)
#WRF B
#plot smooth frames
p_wrf_b <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_bothb, y = ~both_trendb,
data = smooth_frame_bothb,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothb,
'</br> Median Log Copies: ', round(both_trendb, digits = 2)),
line = list(color = '#D95F02', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_bothb, ymin = ~both_yminb, ymax = ~both_ymaxb,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothb, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxb, digits = 2),
'</br> Min Log Copies: ', round(both_yminb, digits = 2)),
name = "",
fillcolor = '#D95F02',
line = list(color = '#D95F02')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF B") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfb_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#D95F02', size = 6, opacity = 0.65))
p_wrf_b
save(p_wrf_b, file = "./plotly_objs/p_wrf_b.rda")
#**************************************WRF C PLOT********************************************** #add trendlines #extract data from geom_smooth # *********************************span 0.6*********************************** #*****************Must always update the n = TOTAL NUMBER OF DAYS*************************
extract_bothc <- ggplot(wrfc_both, aes(x = date, y = log_total_copies_both)) +
stat_smooth(aes(outfit=fit_bothc<<-..y..), method = "loess", color = '#E7298A',
span = 0.25, n = 786)
## Warning: Ignoring unknown aesthetics: outfit
#look at the fits to align dates and total observations
#both
extract_bothc
## `geom_smooth()` using formula 'y ~ x'
fit_bothc
## [1] 12.05657 12.04985 12.04323 12.03671 12.03028 12.02394 12.01770 12.01154
## [9] 12.00548 11.99951 11.99363 11.98783 11.98212 11.97650 11.97097 11.96551
## [17] 11.96015 11.95486 11.94965 11.94453 11.93949 11.93452 11.92963 11.92482
## [25] 11.92009 11.91543 11.91085 11.90634 11.90190 11.89753 11.89324 11.88901
## [33] 11.88486 11.88077 11.87675 11.87279 11.86890 11.86508 11.86131 11.85761
## [41] 11.85398 11.85040 11.84688 11.84343 11.84003 11.83668 11.83340 11.83017
## [49] 11.82699 11.82387 11.82080 11.81779 11.81484 11.81195 11.80913 11.80638
## [57] 11.80370 11.80109 11.79856 11.79610 11.79373 11.79144 11.78924 11.78713
## [65] 11.78511 11.78318 11.78135 11.77962 11.77799 11.77646 11.77504 11.77373
## [73] 11.77254 11.77145 11.77049 11.76965 11.76892 11.76833 11.76786 11.76752
## [81] 11.76732 11.76725 11.76731 11.76752 11.76787 11.76837 11.76902 11.76982
## [89] 11.77077 11.77188 11.77314 11.77457 11.77603 11.77741 11.77871 11.77996
## [97] 11.78117 11.78235 11.78352 11.78468 11.78587 11.78708 11.78833 11.78964
## [105] 11.79103 11.79250 11.79407 11.79576 11.79757 11.79953 11.80164 11.80393
## [113] 11.80641 11.80908 11.81197 11.81509 11.81845 11.82206 11.82595 11.83013
## [121] 11.83461 11.83940 11.84451 11.84998 11.85580 11.86199 11.86856 11.87554
## [129] 11.88384 11.89426 11.90659 11.92063 11.93618 11.95305 11.97103 11.98992
## [137] 12.00953 12.02965 12.05009 12.07064 12.09110 12.11128 12.13098 12.14999
## [145] 12.16812 12.18517 12.20093 12.21521 12.22781 12.24108 12.25736 12.27637
## [153] 12.29786 12.32157 12.34725 12.37464 12.40347 12.43348 12.46443 12.49604
## [161] 12.52807 12.56025 12.59233 12.62404 12.65513 12.68534 12.71441 12.74208
## [169] 12.76809 12.79218 12.81411 12.83359 12.85039 12.86424 12.87488 12.88362
## [177] 12.89193 12.89981 12.90724 12.91419 12.92065 12.92662 12.93206 12.93697
## [185] 12.94133 12.94512 12.94833 12.95094 12.95293 12.95430 12.95502 12.95507
## [193] 12.95445 12.95313 12.95111 12.94835 12.94486 12.94061 12.93558 12.92976
## [201] 12.92314 12.91570 12.90741 12.89828 12.88827 12.87564 12.85889 12.83844
## [209] 12.81468 12.78801 12.75884 12.72755 12.69457 12.66027 12.62507 12.58937
## [217] 12.55356 12.51804 12.48323 12.44951 12.41729 12.38696 12.35894 12.33361
## [225] 12.31138 12.29266 12.27474 12.25480 12.23307 12.20976 12.18508 12.15926
## [233] 12.13250 12.10502 12.07705 12.04878 12.02046 11.99227 11.96446 11.93722
## [241] 11.91077 11.88534 11.86114 11.83837 11.81727 11.79805 11.78091 11.76537
## [249] 11.75072 11.73692 11.72390 11.71161 11.70000 11.68900 11.67856 11.66863
## [257] 11.65913 11.65003 11.64125 11.63275 11.62447 11.61634 11.60832 11.60034
## [265] 11.59236 11.58430 11.57612 11.56775 11.55915 11.55025 11.54100 11.53133
## [273] 11.52120 11.51157 11.50334 11.49639 11.49058 11.48579 11.48188 11.47873
## [281] 11.47619 11.47415 11.47246 11.47100 11.46963 11.46823 11.46666 11.46479
## [289] 11.46250 11.45964 11.45610 11.45172 11.44640 11.43999 11.43270 11.42487
## [297] 11.41656 11.40783 11.39876 11.38940 11.37982 11.37008 11.36024 11.35038
## [305] 11.34055 11.33081 11.32124 11.31189 11.30283 11.29412 11.28583 11.27802
## [313] 11.27076 11.26411 11.25812 11.25112 11.24154 11.22967 11.21580 11.20021
## [321] 11.18318 11.16500 11.14596 11.12633 11.10640 11.08645 11.06677 11.04765
## [329] 11.02936 11.01220 10.99643 10.98236 10.97026 10.96042 10.95311 10.94864
## [337] 10.94727 10.94817 10.95026 10.95349 10.95778 10.96309 10.96935 10.97650
## [345] 10.98448 10.99322 11.00267 11.01277 11.02345 11.03466 11.04633 11.05840
## [353] 11.07081 11.08350 11.09642 11.10949 11.12266 11.13587 11.14905 11.16356
## [361] 11.18066 11.20015 11.22184 11.24553 11.27101 11.29809 11.32658 11.35628
## [369] 11.38699 11.41850 11.45063 11.48318 11.51595 11.54874 11.58135 11.61359
## [377] 11.64525 11.67615 11.70608 11.73485 11.76225 11.78810 11.81219 11.83433
## [385] 11.85431 11.87409 11.89562 11.91867 11.94303 11.96849 11.99482 12.02183
## [393] 12.04929 12.07699 12.10471 12.13225 12.15938 12.18589 12.21156 12.23619
## [401] 12.25956 12.28144 12.30164 12.31993 12.33611 12.34994 12.36240 12.37455
## [409] 12.38640 12.39791 12.40908 12.41989 12.43032 12.44036 12.44999 12.45919
## [417] 12.46796 12.47627 12.48411 12.49146 12.49831 12.50463 12.51043 12.51567
## [425] 12.52035 12.52444 12.52793 12.53024 12.53088 12.52997 12.52762 12.52397
## [433] 12.51915 12.51326 12.50644 12.49882 12.49050 12.48163 12.47231 12.46268
## [441] 12.45286 12.44297 12.43314 12.42349 12.41414 12.40521 12.39684 12.38915
## [449] 12.38225 12.37627 12.36982 12.36154 12.35161 12.34022 12.32755 12.31378
## [457] 12.29911 12.28370 12.26776 12.25145 12.23497 12.21850 12.20222 12.18632
## [465] 12.17098 12.15638 12.14271 12.13015 12.11888 12.10910 12.10098 12.09287
## [473] 12.08313 12.07196 12.05957 12.04614 12.03188 12.01699 12.00167 11.98612
## [481] 11.97053 11.95512 11.94007 11.92559 11.91188 11.89914 11.88757 11.87736
## [489] 11.86872 11.86185 11.85694 11.85420 11.85311 11.85299 11.85378 11.85543
## [497] 11.85789 11.86110 11.86501 11.86958 11.87474 11.88044 11.88663 11.89327
## [505] 11.90029 11.90764 11.91528 11.92314 11.93118 11.93934 11.94757 11.95582
## [513] 11.96403 11.97215 11.98013 11.98792 11.99547 12.00271 12.01101 12.02164
## [521] 12.03439 12.04909 12.06556 12.08359 12.10301 12.12362 12.14525 12.16770
## [529] 12.19078 12.21432 12.23811 12.26198 12.28574 12.30920 12.33217 12.35446
## [537] 12.37590 12.39628 12.41543 12.43315 12.44927 12.46359 12.47592 12.48608
## [545] 12.49388 12.49913 12.50315 12.50735 12.51167 12.51607 12.52049 12.52490
## [553] 12.52924 12.53346 12.53752 12.54136 12.54495 12.54821 12.55112 12.55363
## [561] 12.55567 12.55721 12.55819 12.55857 12.55830 12.55733 12.55561 12.55310
## [569] 12.54974 12.54473 12.53744 12.52809 12.51687 12.50401 12.48970 12.47416
## [577] 12.45759 12.44021 12.42223 12.40385 12.38528 12.36673 12.34842 12.33054
## [585] 12.31331 12.29694 12.28164 12.26761 12.25507 12.24422 12.23246 12.21730
## [593] 12.19913 12.17832 12.15525 12.13030 12.10385 12.07628 12.04798 12.01931
## [601] 11.99067 11.96242 11.93495 11.90865 11.88388 11.86103 11.84048 11.82261
## [609] 11.80780 11.79643 11.78704 11.77793 11.76911 11.76060 11.75242 11.74457
## [617] 11.73706 11.72993 11.72316 11.71679 11.71082 11.70526 11.70014 11.69546
## [625] 11.69124 11.68748 11.68421 11.68144 11.67918 11.67745 11.67625 11.67560
## [633] 11.67552 11.67602 11.67711 11.67881 11.68113 11.68491 11.69087 11.69881
## [641] 11.70852 11.71981 11.73248 11.74633 11.76116 11.77676 11.79295 11.80953
## [649] 11.82628 11.84302 11.85954 11.87565 11.89114 11.90582 11.91948 11.93194
## [657] 11.94298 11.95241 11.96154 11.97176 11.98294 11.99500 12.00782 12.02130
## [665] 12.03533 12.04981 12.06462 12.07968 12.09486 12.11007 12.12519 12.14013
## [673] 12.15478 12.16903 12.18277 12.19591 12.20833 12.21993 12.23061 12.24025
## [681] 12.24876 12.25672 12.26478 12.27291 12.28109 12.28930 12.29750 12.30568
## [689] 12.31380 12.32185 12.32980 12.33763 12.34531 12.35281 12.36011 12.36719
## [697] 12.37401 12.38057 12.38683 12.39276 12.39835 12.40356 12.40816 12.41199
## [705] 12.41512 12.41762 12.41957 12.42106 12.42214 12.42291 12.42344 12.42380
## [713] 12.42407 12.42433 12.42465 12.42511 12.42579 12.42676 12.42810 12.42988
## [721] 12.43219 12.43510 12.43868 12.44252 12.44614 12.44956 12.45282 12.45592
## [729] 12.45890 12.46176 12.46454 12.46724 12.46990 12.47253 12.47516 12.47780
## [737] 12.48047 12.48320 12.48601 12.48891 12.49193 12.49508 12.49840 12.50189
## [745] 12.50545 12.50896 12.51241 12.51583 12.51921 12.52256 12.52588 12.52919
## [753] 12.53249 12.53578 12.53908 12.54238 12.54571 12.54905 12.55242 12.55583
## [761] 12.55928 12.56278 12.56633 12.56994 12.57362 12.57739 12.58126 12.58522
## [769] 12.58928 12.59341 12.59763 12.60191 12.60626 12.61067 12.61513 12.61964
## [777] 12.62419 12.62877 12.63338 12.63802 12.64267 12.64733 12.65199 12.65665
## [785] 12.66130 12.66594
#assign fits to a vector
both_trendc <- fit_bothc
#extract y min and max for each
limits_bothc <- ggplot_build(extract_bothc)$data
## `geom_smooth()` using formula 'y ~ x'
limits_bothc <- as.data.frame(limits_bothc)
both_yminc <- limits_bothc$ymin
both_ymaxc <- limits_bothc$ymax
#reassign dataframes (just to be safe)
work_bothc <- wrfc_both
#fill in missing dates to smooth fits
work_bothc <- work_bothc %>% complete(date = seq(min(date), max(date), by = "1 day"))
date_vec_bothc <- work_bothc$date
#create a new smooth dataframe to layer
smooth_frame_bothc <- data.frame(date_vec_bothc, both_trendc, both_yminc, both_ymaxc)
#WRF C
#plot smooth frames
p_wrf_c <- plotly::plot_ly() %>%
plotly::add_lines(x = ~date_vec_bothc, y = ~both_trendc,
data = smooth_frame_bothc,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothc,
'</br> Median Log Copies: ', round(both_trendc, digits = 2)),
line = list(color = '#E7298A', size = 8, opacity = 0.65),
showlegend = FALSE) %>%
layout(xaxis = list(range = c(mindate - 7, maxdate + 7))) %>% #buffer here
plotly::add_ribbons(x ~date_vec_bothc, ymin = ~both_yminc, ymax = ~both_ymaxc,
showlegend = FALSE,
opacity = 0.25,
hoverinfo = "text",
text = ~paste('</br> Date: ', date_vec_bothc, #leaving in case we want to change
'</br> Max Log Copies: ', round(both_ymaxc, digits = 2),
'</br> Min Log Copies: ', round(both_yminc, digits = 2)),
name = "",
fillcolor = '#E7298A',
line = list(color = '#E7298A')) %>%
layout(yaxis = list(title = "Total Log10 SARS CoV-2 Copies",
showline = TRUE,
automargin = TRUE)) %>%
layout(xaxis = list(title = "Date")) %>%
layout(title = "WRF C") %>%
plotly::add_markers(x = ~date, y = ~log_total_copies_both,
data = wrfc_both,
hoverinfo = "text",
showlegend = FALSE,
text = ~paste('</br> Date: ', date,
'</br> Actual Log Copies: ', round(log_total_copies_both, digits = 2)),
marker = list(color = '#E7298A', size = 6, opacity = 0.65))
p_wrf_c
save(p_wrf_c, file = "./plotly_objs/p_wrf_c.rda")
save(wrfa_both, file = "./plotly_objs/wrfa_both.rda")
save(wrfb_both, file = "./plotly_objs/wrfb_both.rda")
save(wrfc_both, file = "./plotly_objs/wrfc_both.rda")
save(date_vec_botha, file = "./plotly_objs/date_vec_botha.rda")
save(date_vec_bothb, file = "./plotly_objs/date_vec_bothb.rda")
save(date_vec_bothc, file = "./plotly_objs/date_vec_bothc.rda")
save(both_ymina, file = "./plotly_objs/both_ymina.rda")
save(both_ymaxa, file = "./plotly_objs/both_ymaxa.rda")
save(both_yminb, file = "./plotly_objs/both_yminb.rda")
save(both_ymaxb, file = "./plotly_objs/both_ymaxb.rda")
save(both_yminc, file = "./plotly_objs/both_yminc.rda")
save(both_ymaxc, file = "./plotly_objs/both_ymaxc.rda")